/* Copyright (c) 2005 - 2016 Hewlett Packard Enterprise Development LP  -*- Java -*-*/
/* 
 * Description: Example User Defined Transform Function with parameters: Output top-k rows in each partition
 *
 * Create Date: June 1, 2013
 */

package com.vertica.JavaLibs;

import com.vertica.sdk.ColumnTypes;
import com.vertica.sdk.ServerInterface;
import com.vertica.sdk.SizedColumnTypes;
import com.vertica.sdk.TransformFunction;
import com.vertica.sdk.TransformFunctionFactory;

//查询LDAP用户列表
public class LdapUsersFactory extends TransformFunctionFactory
{
    @Override
    public TransformFunction createTransformFunction(ServerInterface srvInterface)
    { return new LdapUsers(); }

    @Override
    public void getReturnType(ServerInterface srvInterface, SizedColumnTypes inputTypes, SizedColumnTypes outputTypes)
    {
        
        
        outputTypes.addVarchar(100,"SAMACCOUNTNAME"); //SAMAccountName
        outputTypes.addVarchar(400,"CANONICALNAME"); //canonicalName
    }

    @Override
    public void getPrototype(ServerInterface srvInterface, ColumnTypes argTypes, ColumnTypes returnType)
    {
    	argTypes.addVarchar();//domainName
        argTypes.addVarchar();//svpIp
        argTypes.addInt();//svpPort
        argTypes.addVarchar();//userName
        argTypes.addVarchar();//password
        argTypes.addVarchar();//dc
	    returnType.addVarchar();//SAMAccountName
	    returnType.addVarchar();//canonicalName
    }

     @Override
    public void getParameterType(ServerInterface srvInterface,
                                 SizedColumnTypes parameterTypes)
    {
        
    }
}
